package com.example.demo.domain;

import com.tanx.cqrs.event.Event;
import lombok.Data;

import java.io.Serializable;
import java.util.UUID;

/**
 *
 */
@Data
public class NameSeted implements Event, Serializable {
    private String name;
    private String uuid = UUID.randomUUID().toString().replaceAll("-", "");
    private String aggregateId;

    public NameSeted() {
    }

    public NameSeted(Company company, String name) {
        this.aggregateId = company.getUuid();
        this.name = name;
    }

    @Override
    public String getUuid() {
        return uuid;
    }

    @Override
    public String getAggregateId() {
        return aggregateId;
    }

    @Override
    public String toString() {
        return "NameSeted{" +
                "name='" + name + '\'' +
                ", uuid='" + uuid + '\'' +
                ", aggregateId='" + aggregateId + '\'' +
                '}';
    }
}
